package com.croofr.dao.service;

import java.lang.reflect.Field;

/**
 * Class for manipulation between persistent class and java fields
 * <p/>
 * User: bednar
 * Date: Mar 28, 2010
 * Time: 11:06:16 AM
 */
public interface Mapping
{
    /**
     * Get java field which is key in persistent service
     *
     * @param persistentUnitClass represent persistent service unit
     * @return fied which is key
     */
    Field getKeyField(Class persistentUnitClass);

    /**
     * Get field by name from persistent unit class withou need control exception
     *
     * @param fieldName           name of field for get
     * @param persistentUnitClass class contains field
     * @return field
     */
    Field getField(String fieldName, Class persistentUnitClass);
}
